{{>partial_header}}
using System;
using System.IO;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
{{#useRestSharp}}
using RestSharp;
{{/useRestSharp}}
using Xunit;

using {{packageName}}.Client;
using {{packageName}}.{{apiPackage}};
using {{packageName}}.{{modelPackage}};

namespace {{packageName}}.Test.Api
{
    /// <summary>
    ///  Class for testing {{classname}}
    /// </summary>
    public class {{classname}}Tests : IDisposable
    {
        private {{clientName}} client;

        public {{classname}}Tests()
        {
            client = new {{clientName}}();
            client.SetBasePath("http://127.0.0.1:{{mockServerPort}}");
            {{> api_doc_auth_partial}}
        }

        public void Dispose()
        {
            // Cleanup when everything is done.
        }
        {{#operations}}
        {{#operation}}

        /// <summary>
        /// Test {{operationId}}
        /// </summary>
        [Fact]
        public void {{operationId}}Test()
        {
            {{> api_doc_example_execute}}
        }
        {{/operation}}
        {{/operations}}
    }
}
